(N/A) The system is rotating about an axis passing through the centre of mass of the system and perpendicular to the rod.
Suppose $C$ is the centre of mass. The distance of each small mass from the centre is $\frac{l}{2}$.
The moment of inertia of each mass about the mentioned axis is given by $I_i = m r^2 = \left(\frac{M}{2}\right)\left(\frac{l}{2}\right)^{2}$.
Therefore,the total moment of inertia of the system is:
$I = I_1 + I_2 = \left(\frac{M}{2}\right)\left(\frac{l}{2}\right)^{2} + \left(\frac{M}{2}\right)\left(\frac{l}{2}\right)^{2}$
$I = 2 \times \left(\frac{M}{2}\right)\left(\frac{l}{2}\right)^{2}$
$I = M \times \frac{l^2}{4} = \frac{M l^{2}}{4}$